<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>页面管理</title>
    <link rel="stylesheet" href="${base}/res/manage/css/common.css">
    <link rel="stylesheet" href="${base}/res/manage/css/ec.css">
    <link rel="stylesheet" href="${base}/res/manage/css/list.css">
    <link rel="stylesheet" type="text/css" href="${base}/res/plugin/magicThumb/magicthumb.css"/>
    <script type="text/javascript" src="${base}/res/plugin/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${base}/res/plugin/validator/jquery.validate.min.js"></script>
    <script type="text/javascript" src="${base}/res/plugin/layer/layer.min.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/res/admin/js/list.js"></script>
    <script type="text/javascript" src="${base}/res/plugin/magicThumb/magicthumb.js"></script>
    <script type="text/javascript">
        $(function () {
        [@flash_message /]
        });

        function add() {
            var arr = [];
            $("input[name='ids']").each(function () {
                var _this = $(this);
                var o = {};
                if (_this.prop("checked")) {
                    o.id = _this.val();
                    o.image = _this.closest("tr").find("img").attr("src");
                    o.name = _this.closest("td").next().next().text();
                    arr.push(o);
                }
            });
            parent.build(arr);
        }

        function addAndClose() {
            var arr = [];
            $("input[name='ids']").each(function () {
                var _this = $(this);
                var o = {};
                if (_this.prop("checked")) {
                    o.id = _this.val();
                    o.image = _this.closest("tr").find("img").attr("src");
                    o.name = _this.closest("td").next().next().text();
                    arr.push(o);
                }
            });
            parent.build(arr);
            var index = parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        }
    </script>
</head>
<body>
<div class="tab set">
    <h3><a href="javascript:;">微信管理</a><a href="javascript:;">> 图文内容</a></h3>
    <form id="listForm" action="listContent.jhtml" method="get">
        <div class="txte">
            <a id="addType" href="javascript:;" onClick="add()" class="ared"> + 添加</a>
            <a id="addType" href="javascript:;" onClick="addAndClose()" class="ared"> + 添加并关闭</a>
            <p class="txtp">
                <input type="text" name="title" id="title" placeholder="文章标题" value="${article.title}" class="txt">
                <input type="submit" value="搜索" class="txt red">
            </p>
        </div>
        <div class="tablist">
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <th>
                        <input type="checkbox" id="selectAll" />
                    </th>
                    <th>文章封面</th>
                    <th>文章标题</th>
                </tr>
            [#list page.list as article]
                <tr>
                    <td>
                        <input type="checkbox" name="ids" value="${article.id}" />
                    </td>
                    <td>
                        [#if article.image??]
                            <a href="${article.image}" class="MagicThumb">
                                <img src="${article.image}" class="tdimg img"/>
                            </a>
                        [/#if]
                    </td>
                    <td>
                    ${article.title}
                    </td>
                </tr>
            [/#list]
            </table>
        [@pagination pageNumber = page.pageNumber totalPages = page.pages]
            [#include "/admin/include/pagination.ftl"]
        [/@pagination]
        </div>
    </form>
</div>
</body>
</html>